package com.stox.services.data.downloader.model;

public abstract class AbstractDataDownloader<T> implements DataDownloader<T> {

	private boolean running;
	private boolean cancelRequested;
	
	@Override
	public void cancel() {
		cancelRequested = true;
		while(running){
			Thread.yield();
		}
	}
	
	public boolean isCancelRequested() {
		return cancelRequested;
	}
	
	public boolean isRunning() {
		return running;
	}
	
	protected void setRunning(boolean value){
		this.running = value;
	}
	
}
